<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/PrepskillsFont.css" />
<title>Ask PREPSKILLS Form</title>
<script type="text/javascript">
function submitForm(){
	var fname = document.getElementById("editfullname").value;
	var email = document.getElementById("editemail").value;
	var phone = document.getElementById("editprimaryphone").value;
	var catergory = document.getElementById("editquestioncatergory").value;
	var question = document.getElementById("yourquestions").value;
	var message = "";

	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		
    if(fname == "" || fname == null){
        message = "Full Name field is required.\n";
    } 
    if(email == "" || email == null){
        message = message + "Email field is required.\n";
    }
    if(reg.test(email) == false) {
    	 message = message + "Invalid Email Address.\n";
	}
    if(phone == "" || phone == null){
        message = message + "Phone # field is required.\n";
    }
    if(catergory == "" || catergory == null){
        message = message + "Question Catergory field is required.\n";
    }
    if(question == "" || question == null){
        message = message + "Your Question field is required.\n";
    }
    if(question == "" || question == null){
    	alert(message);
    }
    else
        alert('Request submitted successfully');
 }

</script>
</head>
<body>
<form action="/GeneralWeb/servlet/com.gs2.servlet.CommandServlet" accept-charset="UTF-8" method="post">
<input type="hidden" name="action" value="askprepskills">
<table bgcolor="034016" border=0 cellpadding="0" cellspacing="0"
	align="center" width="960">
	<tr>
		<td>
		<table bgcolor="ffffff" border=0 cellpadding="2" cellspacing="0"
			align="center" class="askprepform" width="940">
	<tr>
		<td colspan="2" align="center"><img height="25" width="910"
			src="staticContent/images/bread_crumb_image.jpg" alt="Prepskills">
		</td>
	</tr>
			<tr>
				<td colspan="2">
				<h1 class="prepskillsorangetitle">Ask PREPSKILLS Form</h1>
				</td>
			</tr>
			<tr>
				<td>Full Name: *</td>
				<td><input type="text" maxlength="128" id="editfullname" size="40" value=""/></td>
			</tr>
			<tr>
				<td>Email: *</td>
				<td><input type="text" maxlength="128" id="editemail" size="40" value=""/></td>
			</tr>
			<tr>
				<td>Primary
				Phone: *</td>
				<td><input type="text" maxlength="128" id="editprimaryphone" size="40" value="" /></td>
			</tr>
			<tr>
				<td width="250px;">Question Catergory: *</td>
				<td><select id="editquestioncatergory">
					<option value="" selected="selected">select...</option>
					<option value="SSAT">SSAT</option>
					<option value="SAT/ACT">SAT/ACT</option>
					<option value="Other">Other</option>
				</select></td>
			</tr>
			<tr>
				<td>Your Question(s): *</td>
				<td><textarea cols="72" rows="2" id="yourquestions"></textarea></td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" name="op" id="editsubmit"
					value="Submit" onclick="submitForm();"/></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</form>
</body>
</html>